#!usr/bin/env python  
#@time: 2018/01/19 
import subprocess

print('$ nslookup www.python.org')

r = subprocess.call(['nslookup','www.python.org'])

print('Exit code:', r)